﻿using LJX.SmartPark.Common.ResponseOutput;
using LJX.SmartPark.Domain.IotInfo.SmartGarbageCans;
using LJX.SmartPark.Domain.IotInfo.SmartLamp;
using LJX.SmartPark.Service.IotInfo.SmartGarbageCan;
using LJX.SmartPark.Service.IotInfo.SmartLamp;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace LJX.SmartPark.WebApi.Controllers.IotInfo
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = "IotInfo")]
    public class SmartGarbageCanController : ControllerBase
    {
        private readonly ISmartGarbageCanService _SmartGarbageCanService;
        public SmartGarbageCanController(ISmartGarbageCanService SmartGarbageCanService)
        {
            _SmartGarbageCanService = SmartGarbageCanService;
        }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Task<Response<bool>> PostAddSmartGarbageCan(SmartGarbageCan input)
        {
            var result = _SmartGarbageCanService.SmartGarbageCanAdd(input);
            return result;
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpDelete]
        public Task<Response<bool>> DeleteSmartGarbageCan(SmartGarbageCan input)
        {
            var result = _SmartGarbageCanService.SmartGarbageCanDelete(input);
            return result;
        }
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPut]
        public Task<Response<bool>> PutUpdateSmartGarbageCan(SmartGarbageCan input)
        {
            var result = _SmartGarbageCanService.SmartGarbageCanUpdate(input);

            return result;

        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        public Response<List<SmartGarbageCan>> GetSmartGarbageCanAsync()
        {
            var result = _SmartGarbageCanService.GetSmartGarbageCanAsync();
            return result.Result;
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost]
        public Response<SmartGarbageCan> GetSmartGarbageCanById(SmartGarbageCan input)
        {
            var student = _SmartGarbageCanService.GetSmartGarbageCanData(input);
            return student;
        }
    }
}
